import request from "@/utils/request";

/**
 * 查询列表
 * limit 页面条数
 * page 页码
 **/
export function getCompanyList(query) {
  return request({
    url: "/company/manager/queryCompanyManagerList",
    method: "post",
    params: query
  });
}

// 查询详细
export function getCompanyInfo(configId) {
  return request({
    url: "/company/manager/getCompanyManagerById",
    method: "post",
    params: {
      id: configId
    }
  });
}

// 查询信息通知
export function getCompanyInfoNotice(configId) {
  return request({
    url: "/thinkerdata/companyInfoNotice/selectById/" + configId,
    method: "post"
  });
}

// 查询日志
export function getCompanyInfoLog(configId) {
  return request({
    url: "/thinkerdata/companyInfoLog/getCompanyInfoLog/" + configId,
    method: "get"
  });
}

// 获取用户信息
export function getUserList() {
  return request({
    url: "/system/user/getUserList",
    method: "get"
  });
}

// 新增配置
export function addCompanyInfo(data) {
  return request({
    url: "/company/manager/addCompanyManager",
    method: "post",
    data: data
  });
}

// 新增企业信息通知详情
export function addSystemMessage(data) {
  return request({
    url: "/system/message/addSystemMessage",
    method: "post",
    data: data
  });
}

// 修改配置
export function updateCompanyInfo(data) {
  return request({
    url: "/company/manager/updateCompanyManager",
    method: "post",
    data: data
  });
}

// 修改企业信息通知详情
export function updateCompanyInfoNotice(data) {
  return request({
    url: "/thinkerdata/companyInfoNotice/updateCompanyInfoNotice",
    method: "put",
    data: data
  });
}

// 删除配置
// export function deleteCompanyInfo(creatorId, configId) {
//   return request({
//     url: "/thinkerdata/companyInfo/delete/" + configId + "/" + creatorId,
//     method: "delete"
//   });
// }
export function deleteCompanyInfo(ids) {
  return request({
    url: "/company/manager/delCompanyManager",
    method: "post",
    params: {
      ids
    }
  });
}

// 导出
export function exportConfig(query) {
  return request({
    url: "/thinkerdata/companyInfo/export",
    method: "get",
    params: query
  });
}
